import request from "@/utils/request";

/**
 * 获取月度统计分页列表
 * @param data
 */
export function QueryReportProjectMonth(data: any) {
  let url = "";
  switch (localStorage.getItem("usertypeName")) {
    case "Manager":
      url = "/api/v1/manager/reportProjectMonth/page";
      break;
    case "Corp":
      url = "/api/v1/corp/reportProjectMonth/page";
      break;
    case "Constructor":
      url = "/api/v1/constructor/reportProjectMonth/page";
      break;
    case "Commander":
      url = "/api/v1/commander/reportProjectMonth/page";
      break;
    case "SysUser":
      url = "/api/v1/sysuser/reportProjectMonth/page";
      break;
  }
  return request({
    url: url,
    method: "get",
    params: data,
  });
}

/**
 * 获取月度统计详情
 * @param data
 */
export function GetReportProjectMonth(id: any) {
  let url = "";
  switch (localStorage.getItem("usertypeName")) {
    case "Manager":
      url = `api/v1/manager/reportProjectMonth/${id}/form`;
      break;
    case "Corp":
      url = `api/v1/corp/reportProjectMonth/${id}/form`;
      break;
    case "Constructor":
      url = `api/v1/constructor/reportProjectMonth/${id}/form`;
      break;
    case "Commander":
      url = `api/v1/commander/reportProjectMonth/${id}/form`;
      break;
    case "SysUser":
      url = `api/v1/sysuser/reportProjectMonth/${id}/form`;
      break;
  }
  return request({
    url: `api/v1/sysuser/reportProjectMonth/${id}/form`,
    method: "get",
  });
}
